import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { CalendarIcon, ArrowRightIcon } from "lucide-react" import Image from "next/image" import Link from "next/link" import Navigation from "@/components/navigation" import Footer from "@/components/footer" import { ThemeProvider } from "@/components/theme-provider" import { useTranslations } from "next-intl" import { Metadata } from "next" export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const titles = { en: "Blog - Aiartools | AI Image Editing Tips & News", zh: "博客 - Aiartools | AI图像编辑技巧与新闻" } const descriptions = { en: "Discover the latest AI image editing tips, tutorials, and news from Aiartools. Learn how to transform your images with artificial intelligence.", zh: "探索来自Aiartools的最新AI图像编辑技巧、教程和新闻。学习如何用人工智能变换您的图像。" } const title = titles[locale as keyof typeof titles] || titles.en const description = descriptions[locale as keyof typeof descriptions] || descriptions.en return { title, description, openGraph: { title, description, url: `https://aiartools.com/${locale}/blog`, siteName: "Aiartools", locale: locale === 'zh' ? 'zh_CN' : 'en_US', type: 'website', }, twitter: { card: 'summary', title, description, }, alternates: { canonical: `https://aiartools.com/${locale}/blog`, languages: { 'en': 'https://aiartools.com/en/blog', 'zh': 'https://aiartools.com/zh/blog', }, }, } } interface BlogPageProps { params: Promise<{ locale: string }> } export default async function BlogPage({ params }: BlogPageProps) { const { locale } = await params return (
) } function BlogContent({ locale }: { locale: string }) { const t = useTranslations("blog") // 博客文章配置,按时间顺序排列 const blogPostsConfig = [ { key: "contact", link: `/${locale}/blog/contact-us`, sortDate: "2025-06-01", image: "/images/Get in Touch with Aiartools Team.png" }, { key: "editingGuide", link: `/${locale}/blog/how-to-edit-images`, sortDate: "2025-06-01", image: "/images/How to Edit Images with Aiartools.png" }, { key: "introduction", link: `/${locale}/blog/introducing-aiartools`, sortDate: "2025-05-31", image: "/images/Transform Your Images with the Power of AI.png" }, ] // 按时间排序(最新的在前) const sortedPosts = blogPostsConfig.sort((a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime() ) return (

{t("title")}

{t("subtitle")}

{/* All Posts */}

{t("allPosts")}

{sortedPosts.map((postConfig, index) => (
{t(`posts.${postConfig.key}.title`)}
{t(`posts.${postConfig.key}.category`)}
{t(`posts.${postConfig.key}.date`)}

{t(`posts.${postConfig.key}.title`)}

{t(`posts.${postConfig.key}.excerpt`)}

))}
) }